Skip to content

Conversation

ChrisChV
Copy link
Member

  • navigateTo Updated to support a callback function.
  • useRunOnNextRender Updated to support args.
  • setSidebarTab Updated to use useRunOnNextRender
  • setSidebarAction Updated to use useRunOnNextRender

…in sidebar

* `navigateTo` Updated to support a callback function.
* `useRunOnNextRender` Updated to support args.
* `setSidebarTab` Updated to use `useRunOnNextRender`
* `setSidebarAction` Updated to use `useRunOnNextRender`
@ChrisChV
Copy link
Member Author

@bradenmacdonald

Wow, I wish there were a better way to do this. I see we're already using it in a few other places.

What is the reason we can't just do something like

navigateTo({ selectedItemId: container.originalId, sidebarAction: SidebarActions.JumpToManageTags >});

?

The sidebarAction could not be passed to navigateTo, it is necessary to use setSidebarAction, so that it updates correctly.
I added a callback to the navigateTo and moved useRunOnNextRender in setSidebarTab/setSidebarAction.

But it seems that this solution is a bit unstable, because it works in most cases, but it doesn't work for the "add to collections" in the component card menu. I'm out of ideas now.

@bradenmacdonald
Copy link
Member

Why are we navigating then changing the sidebar tab? Can't we just make the sidebar tab so that it's completely based on the query string / search params, and then we just need to navigate to /whatever/url?sidebar=tab and it will work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants